﻿using Entity;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IService
{
    public interface ITransferOrderService
    {
        // 拆分 ioStatus 为 ioType + ioStatus，传递所有必要参数
        Task<List<TransferOrderDTO>> GetTransferOrdersAsync(
            string transnoNo,
            string documentStatus,
            string ioType,   // 出入库类型（out/in）
            string ioStatus, // 出入库状态（0/1/2）
            DateTime? startDate,
            DateTime? endDate,
            int pageIndex,
            int pageSize);

        Task<int> GetTransferOrdersCountAsync(
            string transnoNo,
            string documentStatus,
            string ioType,
            string ioStatus,
            DateTime? startDate,
            DateTime? endDate);

        // 其他方法保持不变...
        Task<bool> CancelAsync(int transferOrderId, string operatorUser);
        Task<bool> DeleteAsync(int transferOrderId);
        Task<bool> BatchDeleteAsync(List<int> ids);
        Task<TransferOrderDTO> GetTransferOrderByIdAsync(int id);
        Task<bool> CreateTransferAsync(TransferOrderCreateDTO dto);
        Task<List<TransferOrderDetailDTO>> GetTransferOrderDetailsAsync(int transferOrderId);
        Task<bool> AuditAsync(int transferOrderId, string auditor);
        Task<bool> AuditAsync(int transferOrderId, string auditor, string auditResult);
        Task<List<TransferOrderExportDTO>> GetExportDataAsync(string transnoNo, string documentStatus, string ioStatus, DateTime? startDate, DateTime? endDate);
        Task<bool> UpdateStatusAsync(int id, string documentStatus, string outboundStatus, string storageStatus);
        Task<bool> AuditAsync(int transferOrderId, string auditor, string auditResult, DbTransaction transaction);
        Task<bool> UpdateStatusAsync(int id, string documentStatus, string outboundStatus, string storageStatus, DbTransaction transaction);
        Task<TransferOrderDTO> GetTransferOrderByIdAsync(int id, DbTransaction transaction);
        Task<List<TransferOrderDetailDTO>> GetTransferOrderDetailsAsync(int transferOrderId, DbTransaction transaction);
        Task<List<StorageLocationEntity>> GetStorageLocationsByWarehouseAsync(int warehouseId);
    }
}